//package com.jic.order.controller.manage;
//
//import com.alibaba.fastjson.JSON;
//import com.jic.common.base.vo.Page;
//import com.jic.common.base.vo.PageResult;
//import com.jic.common.base.vo.RestResult;
//import com.jic.common.base.vo.enums.DeptTypeEnums;
//import com.jic.order.entity.OrderMerge;
//import com.jic.order.entity.OrderPayDetail;
//import com.jic.order.manage.request.OrderMergeRequest;
//import com.jic.order.manage.request.OrderPayDetailRequest;
//import com.jic.order.manage.request.OrderRefundRequest;
//import com.jic.order.manage.response.OrderMergeResponse;
//import com.jic.order.manage.response.OrderPayDetailResponse;
//import com.jic.order.manage.response.OrderRefundResponse;
//import com.jic.order.service.OrderPayDetailService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.stream.Collectors;
//
//@Slf4j
//@Api(value = "订单支付信息", tags = {"订单支付"})
//@RequestMapping(value = "orderPayDetail")
//@RestController
//public class OrderPayDetailController {
//    @Autowired
//    private OrderPayDetailService orderPayDetailService;
//
//    @ApiOperation(value = "获取所有订单合并信息")
//    @ResponseBody
//    @PostMapping(value = "/queryPage")
//    public RestResult<PageResult<OrderPayDetailResponse>> queryPage(@RequestBody OrderPayDetailRequest form) {
//        log.info("开始调用订单合并分页，{}", JSON.toJSONString(form));
//        Page page = new Page();
//        page.setLimit(form.getLimit());
//        page.setStart(form.getStart());
//        OrderPayDetail orderPayDetail = new OrderPayDetail();
//        BeanUtils.copyProperties(form, orderPayDetail);
//        DeptTypeEnums deptType = form.getAdminOperate().getDeptType();
//        if (deptType.getCode() != 0) {
//            orderPayDetail.setDeptId(form.getDeptId());
//        }
//        PageResult<OrderPayDetail> result = orderPayDetailService.queryPage(orderPayDetail, page);
//        List<OrderPayDetailResponse> orderPayDetailResponseList = result.getRows().stream().map(temp -> {
//            OrderPayDetailResponse orderPayDetailResponse = new OrderPayDetailResponse();
//            BeanUtils.copyProperties(temp, orderPayDetailResponse);
//            return orderPayDetailResponse;
//        }).filter(item -> item != null).collect(Collectors.toList());
//        PageResult<OrderPayDetailResponse> pageResult = new PageResult<>();
//        pageResult.setRows(orderPayDetailResponseList);
//        pageResult.setTotal(orderPayDetailResponseList.size());
//        return RestResult.success(pageResult);
//    }
//
//}
